import axios from 'axios'
import qs  from 'qs'
const headers = {
    'Content-Type':'application/x-www-form-urlencoded'
}
let servicename = "/api";

export const login = async (username, pwd)=>{
    let response = await axios({
        headers,
        method:"post",
        url:servicename+"/login",
        data:qs.stringify({
            username,
            pwd
        })
    })
    return response;
}

export const register = async (username, pwd)=>{
    let response = await axios({
        headers,
        method:"post",
        url:servicename+"/register",
        data:qs.stringify({
            username,
            pwd
        })
    })
    return response;
}

